export default class error {

  /* 根据错误信息，拼接错误
  * @param {*} contrast 中英文对照表
  * @param {*} ctxBody  返回参数
  */
  public static contrastError(contrast: any, ctxBody: any) {
    let errorWordArr: Array<any> = []
    contrast.forEach((v: any) => {
      if (!!!ctxBody[v.name]) {
        errorWordArr.push(v.errorWord)
      }
    });

    var errorWord = ""
    if (errorWordArr.length != 0) {
      errorWord = "请输入"
      errorWordArr.forEach((v: any, i: any) => {
        if (i != errorWordArr.length - 1) {
          errorWord += v + ","
        } else {
          errorWord += v
        }
      });
    }

    return errorWord
  }
}